# http://www.codebaoku.com/scrapy/scrapy-index.html
import scrapy

# 爬虫类
class BaiduSpider(scrapy.Spider):
    # 爬虫名称
    name = 'baidu'
    # 抓取的页面
    start_urls = ['https://baidu.com']

    # 页面解析函数
    def parse(self, response):
        title = response.css('title::text').extract_first()
        print("百度首页的标题：" + title)
